source.connectObject(
'notification-show', this._onNotificationShow.bind(this),
+ 'notification-removed', this._onNotificationRemoved.bind(this),
'destroy', () => this._removeSource(source), this);
this.emit('source-added', source);
}
}
- _onNotificationDestroy(notification) {
+ _onNotificationRemoved(source, notification) {
if (this._notification === notification) {
this._notificationRemoved = true;
if (this._notificationState === State.SHOWN ||
let bannerCount = this._notification ? 1 : 0;
let full = this.queueCount + bannerCount >= MAX_NOTIFICATIONS_IN_QUEUE;
if (!full || notification.urgency === Urgency.CRITICAL) {
- notification.connect('destroy',
- this._onNotificationDestroy.bind(this));
this._notificationQueue.push(notification);
this._notificationQueue.sort(
(n1, n2) => n2.urgency - n1.urgency);